import java.util.Date;
import java.util.Calendar;
/**
 * Class creating html-strings.
 * 
 * @author PUSS1401
 * 
 */
public class HtmlGenerator {
	/**
	 * Creates this instance.
	 * 
	 */
	public HtmlGenerator() {
	}

	/**
	 *  Creates a string that formats and shows the top of the page.
	 * 
	 * @param username
	 * 			The name of the user
	 * @param project
	 * 			The name of the project
	 * @param role
	 * 			The role of the user in the project
	 * @return htmlTop
	 * 			The HTML-code of the top 
	 */
	public String getTop(String username, String project, String role) {
		String htmlTop = "<HTML>";
		htmlTop += "<HEAD><TITLE>E-PUSS - the electronic reporting tool</TITLE><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"></HEAD>";
		htmlTop += "<BODY BGCOLOR=white VLINK=blue>"; 
		htmlTop += "<table width = \"100%\">"; //table1 start
		htmlTop += "<tr><td width = \"20%\"></td><td width = \"60%\">"; //tr1 start, td11 start, td11 end, td12 start
		htmlTop += "<CENTER><FONT COLOR=\"#8C6136\"><FONT SIZE=+4><I>E</I></FONT>-PUSS</FONT></CENTER><BR>";
		htmlTop += "</td><td width = \"20%\"></td></tr>"; //td12 end, td13 start, td13 end, tr1 end
		htmlTop += "<tr><td width = \"20%\">"; //tr2 start, td21 start
		htmlTop += "Username: " + username + "<br>";
		htmlTop += "Project: " + project + "<br>";
		htmlTop += "Role: " + role + "<br>";
		htmlTop += "</td><td width = \"60%\">"; //td21 end, td22 start
		htmlTop += "<CENTER><H1><I>E</I>-PUSS - reporting tool for PUSS</H1></CENTER>";
		htmlTop += "</td><td width = \"20%\"></td></tr>"; //td22 end, td23 start, td23 end, tr2 end
		htmlTop += "</table>"; //table1 end
		return htmlTop;
	}

	/**
	 * Creates a string that formats and shows the bottom of the page.
	 * @return htmlBot
	 * 			The HTML-code of the bot
	 */
	public String getBot() {
		String htmlBot;
		htmlBot = "</center></td><td width=\"20%\"></td></tr></table>";
		htmlBot += "<br><center><FONT SIZE=-1>&copy 2014, Department of LTH.</FONT></center>";
		htmlBot += "</BODY>";
		htmlBot += "</HTML>";
		return htmlBot;
	}
	
	/**
	 * Creates a string that contains the menu when a project has not been chosen
	 * @return  htmlMenu
	 * 			The HTML-code for the main-menu
	 */
	public String getMenu() { 
		String htmlMenu;
		htmlMenu = "<table width =\"100%\">";
		htmlMenu += "<tr><td valign = top width =\"20%\">";
		htmlMenu += "<A HREF=\"Projects\">Projects</A><BR>";
		htmlMenu += "<A HREF=\"newPassword\">Change Password</A><BR>";
		htmlMenu += "<A HREF=\"LogIn\">Log out</A>";
		htmlMenu += "</td><td width =\"60%\"><center>";
		return htmlMenu;
	}
	
	/**
	 * Creates a string that contains the menu when a project has been chosen
	 * @return  htmlMenu
	 * 			The HTML-code for the project-menu
	 */
	public String getProjMenu() { 

		String htmlMenu;
		htmlMenu = "<table width =\"100%\">";
		htmlMenu += "<tr><td valign = top width =\"20%\">";
		htmlMenu += "<A HREF=\"Projects\">Projects</A>";
		htmlMenu += "<UL>";
		htmlMenu += "<A HREF=\"TimeReporting\">Time Reporting</A><BR>";
		htmlMenu += "<A HREF=\"Members\">Members</A><BR>";
		htmlMenu += "<A HREF=\"Statistics\">Statistics</A><BR>";
		htmlMenu += "</UL>";
		htmlMenu += "<A HREF=\"newPassword\">Change Password</A><BR>";
		htmlMenu += "<A HREF=\"LogIn\">Log out</A>";
		htmlMenu += "</td><td width =\"60%\"><center>";
		return htmlMenu;
	}
	/**
	 * Returns a HTML-string of a timereport.
	 * 
	 * @param tr
	 * 			The timereport that is displayed
	 * @return timeReport
	 * 			The HTML-code for a timereport
	 */
	public String viewTimeReport(TimeReport tr) {
		int[][] timeSpent1 = tr.getTimeField2();
		int[] timeSpent2 = tr.getTimeField1();
		int sum;
		String timeReport = "";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200>Name:</TD>";
		timeReport += "<TD WIDTH=200>" + tr.getUser() + "</TD>";
		timeReport += "<TD WIDTH=200>Date:</TD>";
		timeReport += "<TD WIDTH=100>" + tr.getDate() + "</TD> </tr>";
		timeReport += "<TR> <TD>Project group:</TD>";
		timeReport += "<TD>" + tr.getProjectName() + "</TD>";
		timeReport += "<TD>Week:</TD>";
		timeReport += "<TD>" + tr.getWeek() + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Part A: Total time (minutes):</TD>";
		timeReport += "<TD WIDTH=100>" + tr.getTotalTime()
				+ "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part B: Time per activity (minutes):</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=CENTER>Number:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Activity:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>D:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>I:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>F:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>R:</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Total time:</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>11</TD>";
		timeReport += "<TD>SDP</TD>";
		timeReport += "<TD>" + timeSpent1[0][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[0][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[0][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[0][3] + "</TD>";
		sum = timeSpent1[0][0] + timeSpent1[0][1] + timeSpent1[0][2]
				+ timeSpent1[0][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>12</TD>";
		timeReport += "<TD>SRS</TD>";
		timeReport += "<TD>" + timeSpent1[1][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[1][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[1][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[1][3] + "</TD>";
		sum = timeSpent1[1][0] + timeSpent1[1][1] + timeSpent1[1][2]
				+ timeSpent1[1][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>13</TD>";
		timeReport += "<TD>SVVS</TD>";
		timeReport += "<TD>" + timeSpent1[2][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[2][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[2][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[2][3] + "</TD>";
		sum = timeSpent1[2][0] + timeSpent1[2][1] + timeSpent1[2][2]
				+ timeSpent1[2][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>14</TD>";
		timeReport += "<TD>STLDD</TD>";
		timeReport += "<TD>" + timeSpent1[3][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[3][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[3][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[3][3] + "</TD>";
		sum = timeSpent1[3][0] + timeSpent1[3][1] + timeSpent1[3][2]
				+ timeSpent1[3][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>15</TD>";
		timeReport += "<TD>SVVI</TD>";
		timeReport += "<TD>" + timeSpent1[4][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[4][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[4][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[4][3] + "</TD>";
		sum = timeSpent1[4][0] + timeSpent1[4][1] + timeSpent1[4][2]
				+ timeSpent1[4][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>16</TD>";
		timeReport += "<TD>SDDD</TD>";
		timeReport += "<TD>" + timeSpent1[5][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[5][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[5][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[5][3] + "</TD>";
		sum = timeSpent1[5][0] + timeSpent1[5][1] + timeSpent1[5][2]
				+ timeSpent1[5][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>17</TD>";
		timeReport += "<TD>SVVR</TD>";
		timeReport += "<TD>" + timeSpent1[6][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[6][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[6][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[6][3] + "</TD>";
		sum = timeSpent1[6][0] + timeSpent1[6][1] + timeSpent1[6][2]
				+ timeSpent1[6][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>18</TD>";
		timeReport += "<TD>SSD</TD>";
		timeReport += "<TD>" + timeSpent1[7][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[7][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[7][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[7][3] + "</TD>";
		sum = timeSpent1[7][0] + timeSpent1[7][1] + timeSpent1[7][2]
				+ timeSpent1[7][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>19</TD>";
		timeReport += "<TD>Final Report</TD>";
		timeReport += "<TD>" + timeSpent1[8][0] + "</TD>";
		timeReport += "<TD>" + timeSpent1[8][1] + "</TD>";
		timeReport += "<TD>" + timeSpent1[8][2] + "</TD>";
		timeReport += "<TD>" + timeSpent1[8][3] + "</TD>";
		sum = timeSpent1[8][0] + timeSpent1[8][1] + timeSpent1[8][2]
				+ timeSpent1[8][3];
		timeReport += "<TD>" + sum + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=RIGHT>21</TD>";
		timeReport += "<TD WIDTH=509>Functional test</TD>";
		timeReport += "<TD WIDTH=100>" + timeSpent2[0] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>22</TD>";
		timeReport += "<TD>System test</TD>";
		timeReport += "<TD>" + timeSpent2[1] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>23</TD>";
		timeReport += "<TD>Regression test</TD>";
		timeReport += "<TD>" + timeSpent2[2] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>30</TD>";
		timeReport += "<TD>Meeting</TD>";
		timeReport += "<TD>" + timeSpent2[3] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>41</TD>";
		timeReport += "<TD>Lecture</TD>";
		timeReport += "<TD>" + timeSpent2[4] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>42</TD>";
		timeReport += "<TD>Exercise</TD>";
		timeReport += "<TD>" + timeSpent2[5] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>43</TD>";
		timeReport += "<TD>Computer exercise</TD>";
		timeReport += "<TD>" + timeSpent2[6] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>44</TD>";
		timeReport += "<TD>Home reading</TD>";
		timeReport += "<TD>" + timeSpent2[7] + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>100</TD>";
		timeReport += "<TD>Other</TD>";
		timeReport += "<TD>" + timeSpent2[8] + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part C: Time spent at different types of sub activities</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200 ALIGN=CENTER>Activity type</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Activity code</TD>";
		timeReport += "<TD WIDTH=303 ALIGN=CENTER>Description</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Sum</TD> </TR>";
		timeReport += "<TR> <TD>Development and</br> documentation</TD>";
		timeReport += "<TD ALIGN=CENTER>D</TD>";
		timeReport += "<TD>Developing new code, test cases</br>and documentation including</br>documentation of the system</TD>";
		timeReport += "<TD ALIGN=CENTER>" + tr.getU() + "</TD> </TR>";
		timeReport += "<TR> <TD>Informal review</TD>";
		timeReport += "<TD ALIGN=CENTER>I</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for informal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER>" + tr.getI() + "</TD> </TR>";
		timeReport += "<TR> <TD>Formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER>F</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER>" + tr.getF() + "</TD> </TR>";
		timeReport += "<TR> <TD>Rework, </br>improvement or</br>correction</TD>";
		timeReport += "<TD ALIGN=CENTER>R</TD>";
		timeReport += "<TD>Time spent improving, revising</br>or correction documents</br>and design objects</TD>";
		timeReport += "<TD ALIGN=CENTER>" + tr.getO() + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part D: Signature</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Signed by manager</TD>";
		timeReport += "<TD WIDTH=100>" + (tr.signed() ? " Y" : " N")
				+ "</TD> </TR> </TABLE>";
		return timeReport;
	}

	/**
	 * Returns a HTML-string of a timereport with input fields.
	 * 
	 * @param user
	 * 			The name of the user
	 * @param proj
	 * 			The name of the project
	 * @param date
	 * 			The date
	 * 
	 * @return timeReport
	 * 			The HTML-code of the submit form
	 */
	public String submitTimeReportForm(String user, String proj, String date) {
		Date d = Calendar.getInstance().getTime();

		Calendar cal = Calendar.getInstance();
		cal.setTime(d);
		int week = cal.get(Calendar.WEEK_OF_YEAR);
		
		String timeReport = "<form name=" + formElement("input");
		timeReport += " method=" + formElement("get") + ">";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200>Name:</TD>";
		timeReport += "<TD WIDTH=200>" + user + "</TD>";
		timeReport += "<TD WIDTH=200>Date:</TD>";
		timeReport += "<TD WIDTH=100>" + date + "</TD> </tr>";
		timeReport += "<TR> <TD>Project group:</TD>";
		timeReport += "<TD>" + proj + "</TD>";
		timeReport += "<TD>Week:</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("week") + "value=" + week + '>' + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Part A: Total time (minutes):</TD>";
		timeReport += "<TD WIDTH=100></TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part B: Time per activity (minutes):</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=CENTER>Number:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Activity:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>D:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>I:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>F:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>R:</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Total time:</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>11</TD>";
		timeReport += "<TD>SDP</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("00") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("01") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("02") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("03") + "value=" + formElement("0") + '>'
				+ "</TD>";
		
		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>12</TD>";
		timeReport += "<TD>SRS</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("10") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("11") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("12") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("13") + "value=" + formElement("0") + '>'
				+ "</TD>";

		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>13</TD>";
		timeReport += "<TD>SVVS</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("20") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("21") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("22") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("23") + "value=" + formElement("0") + '>'
				+ "</TD>";

		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>14</TD>";
		timeReport += "<TD>STLDD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("30") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("31") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("32") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("33") + "value=" + formElement("0") + '>'
				+ "</TD>";

		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>15</TD>";
		timeReport += "<TD>SVVI</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("40") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("41") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("42") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("43") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>16</TD>";
		timeReport += "<TD>SDDD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("50") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("51") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("52") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("53") + "value=" + formElement("0") + '>'
				+ "</TD>";

		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>17</TD>";
		timeReport += "<TD>SVVR</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("60") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("61") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("62") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("63") + "value=" + formElement("0") + '>'
				+ "</TD>";

		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>18</TD>";
		timeReport += "<TD>SSD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("70") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("71") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("72") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("73") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD></TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>19</TD>";
		timeReport += "<TD>Final Report</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("80") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("81") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("82") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("83") + "value=" + formElement("0") + '>'
				+ "</TD>";
		timeReport += "<TD></TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=RIGHT>21</TD>";
		timeReport += "<TD WIDTH=509>Functional test</TD>";
		timeReport += "<TD WIDTH=100><input type=" + formElement("text")
				+ " name=" + formElement("1") + "value=" + formElement("0")
				+ '>' + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>22</TD>";
		timeReport += "<TD>System test</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("2") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>23</TD>";
		timeReport += "<TD>Regression test</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("3") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>30</TD>";
		timeReport += "<TD>Meeting</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("4") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>41</TD>";
		timeReport += "<TD>Lecture</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("5") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>42</TD>";
		timeReport += "<TD>Exercise</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("6") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>43</TD>";
		timeReport += "<TD>Computer exercise</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("7") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>44</TD>";
		timeReport += "<TD>Home reading</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("8") + "value=" + formElement("0") + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>100</TD>";
		timeReport += "<TD>Other</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("9") + "value=" + formElement("0") + '>'
				+ "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part C: Time spent at different types of sub activities</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200 ALIGN=CENTER>Aktivitetstyp</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Kod</TD>";
		timeReport += "<TD WIDTH=303 ALIGN=CENTER>Beskrivning</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Summa</TD> </TR>";
		timeReport += "<TR> <TD>Development and </br> documentation</TD>";
		timeReport += "<TD ALIGN=CENTER>D</TD>";
		timeReport += "<TD>Developing new code, test cases</br>and documentation including</br>documentation of the system</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Informal review</TD>";
		timeReport += "<TD ALIGN=CENTER>I</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for informal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER>F</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Rework, </br> improvement or </br> correction</TD>";
		timeReport += "<TD ALIGN=CENTER>R</TD>";
		timeReport += "<TD>Time spent improving, revising</br> or correction documents</br> and design objects</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part D: Signature</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Signed by manager</TD>";
		timeReport += "<TD WIDTH=100></TD> </TR> </TABLE>";
		timeReport += "<p> <input type=" + formElement("submit") + "value="
				+ formElement("submit") + '>';
		timeReport += "</form>";
		return timeReport;
	}

	private String formElement(String par) {
		return '"' + par + '"';
	}

	/**
	 * Returns a HTML-string of a timereport with input fields.
	 * 
	 * @param tr
	 * 			The timereport
	 * 
	 * @return timeReport
	 * 			The HTML-code
	 */
	public String updateTimeReportForm(TimeReport tr) {
		int[][] timeSpent1 = tr.getTimeField2();
		int[] timeSpent2 = tr.getTimeField1();
		int sum = 0;
		String timeReport = "<p><form name=" + formElement("input");
		timeReport += " method=" + formElement("get") + ">";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200>Name:</TD>";
		timeReport += "<TD WIDTH=200>" + tr.getUser() + "</TD>";
		timeReport += "<TD WIDTH=200>Date:</TD>";
		timeReport += "<TD WIDTH=100>" + tr.getDate() + "</TD> </tr>";
		timeReport += "<TR> <TD>Project group:</TD>";
		timeReport += "<TD>" + tr.getProjectName() + "</TD>";
		timeReport += "<TD>Week:</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("week") + "value=" + formElement(Integer.toString(tr.getWeek())) +'>' + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Part A: Total time (minutes):</TD>";
		timeReport += "<TD WIDTH=100></TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part B: Time per activity (minutes):</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=CENTER>Number:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Activity:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>D:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>I:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>F:</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>R:</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Total time:</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>11</TD>";
		timeReport += "<TD>SDP</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("00") + "value=" + formElement(Integer.toString(timeSpent1[0][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("01") + "value=" + formElement(Integer.toString(timeSpent1[0][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("02") + "value=" + formElement(Integer.toString(timeSpent1[0][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("03") + "value=" + formElement(Integer.toString(timeSpent1[0][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[0][0] + timeSpent1[0][1] + timeSpent1[0][2]
				+ timeSpent1[0][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>12</TD>";
		timeReport += "<TD>SRS</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("10") + "value=" + formElement(Integer.toString(timeSpent1[1][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("11") + "value=" + formElement(Integer.toString(timeSpent1[1][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("12") + "value=" + formElement(Integer.toString(timeSpent1[1][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("13") + "value=" + formElement(Integer.toString(timeSpent1[1][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[1][0] + timeSpent1[1][1] + timeSpent1[1][2]
				+ timeSpent1[1][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>13</TD>";
		timeReport += "<TD>SVVS</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("20") + "value=" + formElement(Integer.toString(timeSpent1[2][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("21") + "value=" + formElement(Integer.toString(timeSpent1[2][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("22") + "value=" + formElement(Integer.toString(timeSpent1[2][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("23") + "value=" + formElement(Integer.toString(timeSpent1[2][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[2][0] + timeSpent1[2][1] + timeSpent1[2][2]
				+ timeSpent1[2][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>14</TD>";
		timeReport += "<TD>STLDD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("30") + "value=" + formElement(Integer.toString(timeSpent1[3][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("31") + "value=" + formElement(Integer.toString(timeSpent1[3][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("32") + "value=" + formElement(Integer.toString(timeSpent1[3][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("33") + "value=" + formElement(Integer.toString(timeSpent1[3][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[3][0] + timeSpent1[3][1] + timeSpent1[3][2]
				+ timeSpent1[3][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>15</TD>";
		timeReport += "<TD>SVVI</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("40") + "value=" + formElement(Integer.toString(timeSpent1[4][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("41") + "value=" + formElement(Integer.toString(timeSpent1[4][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("42") + "value=" + formElement(Integer.toString(timeSpent1[4][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("43") + "value=" + formElement(Integer.toString(timeSpent1[4][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[4][0] + timeSpent1[4][1] + timeSpent1[4][2]
				+ timeSpent1[4][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>16</TD>";
		timeReport += "<TD>SDDD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("50") + "value=" + formElement(Integer.toString(timeSpent1[5][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("51") + "value=" + formElement(Integer.toString(timeSpent1[5][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("52") + "value=" + formElement(Integer.toString(timeSpent1[5][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("53") + "value=" + formElement(Integer.toString(timeSpent1[5][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[5][0] + timeSpent1[5][1] + timeSpent1[5][2]
				+ timeSpent1[5][3];
		timeReport += "<TD>"+ sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>17</TD>";
		timeReport += "<TD>SVVR</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("60") + "value=" + formElement(Integer.toString(timeSpent1[6][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("61") + "value=" + formElement(Integer.toString(timeSpent1[6][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("62") + "value=" + formElement(Integer.toString(timeSpent1[6][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("63") + "value=" + formElement(Integer.toString(timeSpent1[6][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[6][0] + timeSpent1[6][1] + timeSpent1[6][2]
				+ timeSpent1[6][3];
		timeReport += "<TD>"+ sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>18</TD>";
		timeReport += "<TD>SSD</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("70") + "value=" + formElement(Integer.toString(timeSpent1[7][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("71") + "value=" + formElement(Integer.toString(timeSpent1[7][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("72") + "value=" + formElement(Integer.toString(timeSpent1[7][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("73") + "value=" + formElement(Integer.toString(timeSpent1[7][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[7][0] + timeSpent1[7][1] + timeSpent1[7][2]
				+ timeSpent1[7][3];
		timeReport += "<TD>" + sum + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>19</TD>";
		timeReport += "<TD>Final Report</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("80") + "value=" + formElement(Integer.toString(timeSpent1[8][0])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("81") + "value=" + formElement(Integer.toString(timeSpent1[8][1])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("82") + "value=" + formElement(Integer.toString(timeSpent1[8][2])) + '>'
				+ "</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("83") + "value=" + formElement(Integer.toString(timeSpent1[8][3])) + '>'
				+ "</TD>";
		sum = timeSpent1[8][0] + timeSpent1[8][1] + timeSpent1[8][2]
				+ timeSpent1[8][3];
		timeReport += "<TD>" + sum + "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=97 ALIGN=RIGHT>21</TD>";
		timeReport += "<TD WIDTH=509>Functional test</TD>";
		timeReport += "<TD WIDTH=100><input type=" + formElement("text")
				+ " name=" + formElement("1") + "value=" + formElement(Integer.toString(timeSpent2[0]))
				+ '>' + "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>22</TD>";
		timeReport += "<TD>System test</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("2") + "value=" + formElement(Integer.toString(timeSpent2[1])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>23</TD>";
		timeReport += "<TD>Regression test</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("3") + "value=" + formElement(Integer.toString(timeSpent2[2])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>30</TD>";
		timeReport += "<TD>Meeting</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("4") + "value=" + formElement(Integer.toString(timeSpent2[3])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>41</TD>";
		timeReport += "<TD>Lecture</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("5") + "value=" + formElement(Integer.toString(timeSpent2[4])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>42</TD>";
		timeReport += "<TD>Exercise</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("6") + "value=" + formElement(Integer.toString(timeSpent2[5])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>43</TD>";
		timeReport += "<TD>Computer exercise</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("7") + "value=" + formElement(Integer.toString(timeSpent2[6])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>44</TD>";
		timeReport += "<TD>Home reading</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("8") + "value=" + formElement(Integer.toString(timeSpent2[7])) + '>'
				+ "</TD> </TR>";
		timeReport += "<TR> <TD ALIGN=RIGHT>100</TD>";
		timeReport += "<TD>Other</TD>";
		timeReport += "<TD><input type=" + formElement("text") + " name="
				+ formElement("9") + "value=" + formElement(Integer.toString(timeSpent2[8])) + '>'
				+ "</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part C: Time spent at different types of sub activities</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=200 ALIGN=CENTER>Aktivitetstyp</TD>";
		timeReport += "<TD WIDTH=97 ALIGN=CENTER>Kod</TD>";
		timeReport += "<TD WIDTH=303 ALIGN=CENTER>Beskrivning</TD>";
		timeReport += "<TD WIDTH=100 ALIGN=CENTER>Summa</TD> </TR>";
		timeReport += "<TR> <TD>Development and </br> documentation</TD>";
		timeReport += "<TD ALIGN=CENTER>D</TD>";
		timeReport += "<TD>Developing new code, test cases</br>and documentation including</br>documentation of the system</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Informal review</TD>";
		timeReport += "<TD ALIGN=CENTER>I</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for informal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER>F</TD>";
		timeReport += "<TD>Time spent preparing and at</br>meeting for formal reviews</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR>";
		timeReport += "<TR> <TD>Rework, </br> improvement or </br> correction</TD>";
		timeReport += "<TD ALIGN=CENTER>R</TD>";
		timeReport += "<TD>Time spent improving, revising</br> or correction documents</br> and design objects</TD>";
		timeReport += "<TD ALIGN=CENTER></TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=718>Part D: Signature</TD> </TR> </TABLE>";
		timeReport += "<TABLE BORDER=1 width = \"100%\">";
		timeReport += "<TR> <TD WIDTH=612>Signed by manager</TD>";
		timeReport += "<TD WIDTH=100></TD> </TR> </TABLE>";
		timeReport += "<p> <input type=" + formElement("submit") + "value="
				+ formElement("submit") + '>';
		timeReport += "</form>";
		return timeReport;
	}
	/**
	 * Creates a HTML-string with buttons.
	 * 
	 * @return html
	 * 			The HTML-code
	 */
	public String chooseAlternative() {
		String html = "<button name=" + formElement("project") + "type="
				+ formElement("submit") + "value=" + formElement("project")
				+ ">Project</button>";
		html += "<button name=" + formElement("user") + "type="
				+ formElement("submit") + "value=" + formElement("user")
				+ ">Member</button>";
		html += "<button name=" + formElement("role") + "type="
				+ formElement("submit") + "value=" + formElement("role")
				+ ">Role</button>";
		html += "</form>";
		return html;
	}

	/**
	 * Creates a HTML-string with radio buttons and the name of all members in a project.
	 * 
	 * @param project
	 * 			The name of the project
	 * @param members
	 * 			An array of strings with the names of all members in the project
	 * @return html
	 * 			The HTML-code
	 */
	public String selectMember(String project, String[] members) {
		String html = "<form name=" + formElement("radio");
		html += " method=" + formElement("get") + "> ";

		html += " <input type=" + formElement("radio") + "name="
				+ formElement("ChosenUser") + " value="
				+ formElement(members[0]) + "checked > "
				+ members[0].toUpperCase() + " <br>";
		for (int i = 1; i < members.length; i++) {
			html += " <input type=" + formElement("radio") + "name="
					+ formElement("ChosenUser") + " value="
					+ formElement(members[i]) + " > "
					+ members[i].toUpperCase() + " <br>";
		}
		html += " <input type=" + formElement("submit");
		html += " value=" + formElement("Select user") + '>';
		html += " </form>";
		return html;
	}

	/**
	 * Creates a HTML-string with a menu of all roles.
	 * 
	 * @param rolelist
	 * 			An array of strings with all roles
	 * @return html
	 * 			The HTML-code
	 */
	public String selectRole(String[] rolelist) {
		String html = "<form name=" + formElement("radio");
		html += " method=" + formElement("get") + "> ";
		
		html += " <input type=" + formElement("radio") + "name="
				+ formElement("ChosenRole") + " value="
				+ formElement(rolelist[0]) + "checked > "
				+ rolelist[0].toUpperCase() + " <br>";
		for (int i = 1; i < rolelist.length; i++) {
			html += " <input type=" + formElement("radio") + "name="
					+ formElement("ChosenRole") + " value="
					+ formElement(rolelist[i]) + " > "
					+ rolelist[i].toUpperCase() + " <br>";
		}
		html += " <input type=" + formElement("submit");
		html += " value=" + formElement("Select role") + '>';
		html += " </form>";
		return html;
	}
}
